package 异常.day1.demo2;

public class Test1 {
    public static void main(String[] args) {
        String a[]={"a1","a2","a3"};
        try{
            for(int i=0;i<5;i++){
                System.out.println(a[i]);
            }
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println(e.getMessage());
            System.out.println("数组下标太长了");
        }catch (NullPointerException e){
            System.out.println("数组下标越界了");
        }catch (ArithmeticException | ClassCastException e){

        }

        try {
            System.out.println("....");
        } finally {

        }
    }
}
